﻿<Window x:Class="FreeGoo.WpfDemo.SelectLevelWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:FreeGoo.LevelClasses;assembly=FreeGoo.LevelClasses"
    Title="Select Level " Height="837" Width="782" Loaded="Window_Loaded">

    <Window.Resources>
        <local:CampaignHandler x:Key="CampaignHandler" />
    </Window.Resources>

    <Grid Width="752">
        <Grid.RowDefinitions>
            <RowDefinition Height="40*" />
            <RowDefinition Height="36" />
            <RowDefinition Height="0" />
            <RowDefinition Height="644" />
            <RowDefinition Height="79*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3" />
            <ColumnDefinition Width="163" />
            <ColumnDefinition Width="569" />
            <ColumnDefinition Width="17*" />
        </Grid.ColumnDefinitions>
        <ListBox Grid.Column="1" Grid.Row="3" Margin="0,34,0,142" Name="CampaignListBox" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Campaigns, Source={StaticResource CampaignHandler}}" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding Path=Title}" />                        
                        <Image Source="{Binding Path=BitmapImage}"/>
                        <TextBlock Text="" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Label Grid.Column="1" Margin="0,0,16,0" Name="label1" Grid.Row="3" Height="28" VerticalAlignment="Top">Campaigns</Label>
        <Label Height="28" Margin="6,273,0,0" Name="label2" VerticalAlignment="Top" Grid.Column="2" Grid.Row="3" HorizontalAlignment="Left" Width="247">Levels</Label>
        <ListBox Margin="6,293,0,0" Name="levelListBox" Grid.Column="2" Grid.Row="3" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Campaigns/Levels, Source={StaticResource CampaignHandler}}" HorizontalAlignment="Left" Width="177">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding Path=Title}" />
                        <Image Source="{Binding Path=BitmapImage}"/>
                        <TextBlock Text="" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Image Grid.Column="2" Grid.Row="3" Height="203" Margin="121,47,157,0" Name="CampaignImage" Stretch="Fill" VerticalAlignment="Top" Source="{Binding Campaigns/BitmapImage, Source={StaticResource CampaignHandler}}" />
        <Label Margin="6,0,0,0" Name="CampaignTitle" Grid.Column="2" FontSize="20" Content="{Binding Campaigns/Title, Source={StaticResource CampaignHandler}}" HorizontalContentAlignment="Center" Grid.Row="3" Height="41.329" VerticalAlignment="Top" />
        <Label FontSize="11" Margin="6,215,0,0" Name="CampaignDescription" Grid.Column="2" Height="50" Grid.Row="3" VerticalAlignment="Top" Content="{Binding Campaigns/Description, Source={StaticResource CampaignHandler}}" HorizontalContentAlignment="Center" />
        <Image Margin="283,0,124,131" Name="LevelImage" Stretch="None" Grid.Column="2" Grid.Row="3" Source="{Binding Campaigns/Levels/BitmapImage, Source={StaticResource CampaignHandler}}" Height="131.929" VerticalAlignment="Bottom" />
        <Label Content="{Binding Campaigns/Levels/Title, Source={StaticResource CampaignHandler}}" FontSize="16" HorizontalContentAlignment="Center" Margin="212,293,23,291" Name="label3" Grid.Column="2" Grid.Row="3" />
        <Label Content="{Binding Campaigns/Levels/Description, Source={StaticResource CampaignHandler}}" FontSize="11" HorizontalContentAlignment="Center" Margin="189,0,0,0" Name="label4" Grid.Column="2" Height="125" Grid.Row="3" VerticalAlignment="Bottom" />
        <Button Grid.Column="2" Grid.Row="3" Height="23" HorizontalAlignment="Right" Margin="0,0,23,239.929" Name="PlayButton" VerticalAlignment="Bottom" Width="75" Click="PlayButton_Click">Play Level</Button>
        <Button Grid.Column="2" Margin="19,0,0,13" Name="QuitButton" HorizontalAlignment="Left" Grid.Row="1" Width="75" Click="QuitButton_Click">Quit</Button>
        <Button Grid.Column="2" HorizontalAlignment="Left" Margin="100,0,0,13" Name="HelpButton" Width="75" Grid.Row="1">Help</Button>
        <Button Grid.Column="2" Grid.Row="1" Margin="221,0,273,13" Visibility="Hidden" Name="quickStartButton" Click="QuickStartButton_Click">(Quick Start)</Button>
    </Grid>
</Window>
